//
//  ShapeFactory.swift
//  AbstactFactoryDemo
//
//  Created by 好米有易 on 2017/9/28.
//  Copyright © 2017年 好米有易. All rights reserved.
//

import UIKit

/// 形状工厂
public class ShapeFactory: AbstractFactory {

   

    
    override public func getShape(type: ShapeType) -> Shape {
        
        if type == ShapeType.circle {
            
            return Circle()
        }
        
        if type == ShapeType.rectangle {
            return Rectangle()

        }
        
        if type == ShapeType.square {
            
            return Square()

        }
        
        return super.getShape(type: type)
        
    }
    
}
